package com.ruoyi.common.core.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

@ApiModel(value = "JPA基础实体")
@Getter
@Setter
@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
public class DataBaseEntity extends BaseEntity {

    private static final long serialVersionUID = -8576439273383272326L;
    /**
     * 数据库自增主键
     */
    @ApiModelProperty(value = "主键")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    private Long id;

}
